/**
 * Form fields
 */
label {
  display: inline-block;
  font-weight: bold;
  line-height: 1.5;
  margin-bottom: 0.25em;

  .palette-dark & {
    color: #fff;
  }
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
  background: transparent;
  border-color: _palette(charcoal-light-75);
  border-radius: 0;
  border-style: solid;
  border-width: 0 0 2px;
  box-shadow: none;
  box-sizing: border-box;
  color: inherit;
  display: block;
  font-size: 16px;
  font-weight: normal;
  line-height: 1.5;
  max-width: 100%;
  padding: 0.75em 0;
  width: 100%;

  &:focus {
    outline: 0;
  }

  .palette-dark & {
    border-color: _palette(charcoal-light-7);
  }
}

option {
  color: _palette(charcoal);
}

.form-group {
  margin-bottom: 1.33333em;
  position: relative;

  .animate-border {
    bottom: 0;
    background: _palette(accent);
    height: 2px;
    left: 0;
    position: absolute;
    -webkit-transition: width .3s;
    transition: width .3s;
    width: 0;

    .accent-green & {
      background: _palette(accent-green);
    }
  
    .accent-blue & {
      background: _palette(accent-blue);
    }
  
    .accent-violet & {
      background: _palette(accent-violet);
    }
  
    .accent-yellow & {
      background: _palette(accent-yellow);
    }
  }

  input,
  textarea {
    &:focus + .animate-border {
      width: 100%;
    }
  }
}

.form-submit {
  margin-top: 1.66667em;
}

.form-select-wrap {
  font-size: 16px;
  position: relative;

  select {
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 20px;
  }

  &:before,
  &:after {
    border: solid transparent;
    border-width: .3125em;
    box-sizing: border-box;
    content: "";
    position: absolute;
    right: 5px;
    top: 50%;
    z-index: 1;
  }

  &:before {
    border-top-color: _palette(charcoal-light-40);
    margin-top: .125em;

    .palette-dark & {
      border-top-color: _palette(charcoal-light-25);
    }
  }

  &:after {
    border-bottom-color: _palette(charcoal-light-40);
    margin-top: -.75em;

    .palette-dark & {
      border-bottom-color: _palette(charcoal-light-25);
    }
  }
}

.form-checkbox {
  padding-left: 24px;
  position: relative;

  label {
    font-weight: normal;
  }

  input[type=checkbox] {
    height: 1.5em;
    left: 0;
    position: absolute;
    top: 0;
  }
}

// Placeholder text color
::-webkit-input-placeholder {
  color: _palette(charcoal-light-40);
}

::-moz-placeholder {
  color: _palette(charcoal-light-40);
  opacity: 1;
}

:-ms-input-placeholder {
  color: _palette(charcoal-light-40);
}

::-ms-input-placeholder {
  color: _palette(charcoal-light-40);
}

::placeholder {
  color: _palette(charcoal-light-40);
}

.palette-dark {
  ::-webkit-input-placeholder {
    color: _palette(charcoal-light-25);
  }
  
  ::-moz-placeholder {
    color: _palette(charcoal-light-25);
    opacity: 1;
  }
  
  :-ms-input-placeholder {
    color: _palette(charcoal-light-25);
  }
  
  ::-ms-input-placeholder {
    color: _palette(charcoal-light-25);
  }
  
  ::placeholder {
    color: _palette(charcoal-light-25);
  }
}